import 'package:ref/ref.dart';

class User {
  late String name;
  late int age;
  User();
  User.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    age = json['age'];
  }
}

class UserInfo {
  late User info;
  late int count;
  UserInfo();
  UserInfo.fromJson(dynamic json) {
    info = User.fromJson(json['info']);
    count = json['count'];
  }
}

Map data = {
  'info': {'name': 'kgm', 'age': 12},
  'count': 0
};

var inst = UserInfo.fromJson(data);
var userInfo = Ref(inst);
